﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PhotoGallery.DLL;
using PhotoGallery.Model;
namespace PhotoGallery.BLL
{
    public class FindPass
    {
        UserDataAccess uda = new UserDataAccess();

        public bool findPass(string username,string code) 
        {
            User u=uda.searchUserByUsername(username);
            if (u != null)
            {
                string password = code;
                User myuser = new User(u.Uid, u.Username, password, u.Nickname, u.Time, u.Role);
                uda.modifyUser(u.Uid, myuser);
                return true;
            }
            else 
            {
                return false;
            }
        }
    }
}
